import App from '../App.vue'
import Vue from 'vue'
import Router from 'vue-router';

Vue.use(Router)

// 定义所有路由
const home = r => require.ensure([], () => r(require('../pages/home/home')), 'home')
const item = r => require.ensure([], () => r(require('../pages/item/item')), 'item')
const score = r => require.ensure([], () => r(require('../pages/score/score')), 'item')

const routes = [
  {
    path: '/',
    component: App,
    children: [
      {
        path: '',
        component: home
      }, {
        path: 'home',
        component: home
      }, {
        path: 'item',
        component: item
      }, {
        path: 'score',
        component: score
      }
    ]
  }
]

export default new Router({
  mode: 'history',
  routes: routes
})